//根据不同的moduleTable查对应的查询条件
function queryCondition(fixtypee){
    var str=`<div class="layui-form-item"><label class="layui-form-label">扩展条件：</label><div class="layui-input-block"><select id="condition" name="condition"  lay-filter="fft">`
    for(var i=0;i<fixtypee.length;i++){
        if (fixtypee[i].fieldFrontConditionsFixed == false){
            str+=`<option  value="${fixtypee[i].fields}" fft="${fixtypee[i].fieldFrontType}" ffct="${fixtypee[i].fieldFrontConditionsType}" fst="${fixtypee[i].fieldSearchType}" fieldDefault="${fixtypee[i].fieldFrontConditionsDefault}">${fixtypee[i].fieldName}</option>`
        }
    }
    str+=`</select></div></div>`;
    for(var i=0;i<fixtypee.length;i++){
        if (fixtypee[i].fieldFrontConditionsFixed == true){
            if ( "t_between"==(fixtypee[i].fieldFrontConditionsType)
                && "t_date"!=(fixtypee[i].fieldFrontType)
                && "t_datetime"!=(fixtypee[i].fieldFrontType)){
                var classA = "layui-form-item item-height"
                var labalA = "从"
            } else {
                var classA = "layui-form-item"
                var labalA = ""
            }
            var styleA = "t_textarea"==(fixtypee[i].fieldFrontTemplet) ? "height:auto" :'';
            str+= `<div class="${classA} style="${styleA}">`
            str+= `<label class="layui-form-label">${fixtypee[i].fieldName}${labalA}：</label>`
            if (("t_between"==(fixtypee[i].fieldFrontConditionsType) && ("t_date"!=(fixtypee[i].fieldFrontType)) && ("t_datetime"!=(fixtypee[i].fieldFrontType)))){
                str+=`<div class="layui-input-block">
                        <input type='text' name="${fixtypee[i].fields}'_s'" id="${fixtypee[i].fields}'_s'" class="layui-input search-field" autocomplete="off" fft="t_text" ffct="${fixtypee[i].fieldFrontConditionsType}">
                      </div>`
                str+=`<label class="layui-form-label">到：</label>
                      <div class="layui-input-block">
                         <input type='text' name="${fixtypee[i].fields}'_s'" id="${fixtypee[i].fields}'_s'" class="layui-input search-field" autocomplete="off" fft="t_text" ffct="${fixtypee[i].fieldFrontConditionsType}">
                      </div>`
            }

            if (("t_text"==(fixtypee[i].fieldFrontType)
                || "t_textarea"==(fixtypee[i].fieldFrontType))
                && "t_between"!=(fixtypee[i].fieldFrontConditionsType)){
                str+=`<div class="layui-input-block">`
                str+= `<input  type='text' name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-input search-field" autocomplete="off" fft="t_text" ffct="${fixtypee[i].fieldFrontConditionsType}">`
                if ("t_textarea"==(fixtypee[i].fieldFrontTemplet)){
                    str+= `<textarea name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-textarea search-field" fft="t_text_area" ffct="${fixtypee[i].fieldFrontConditionsType}"></textarea>`
                }
                str+= `<a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>`
                str+=`</div>`
            }

            if (("t_date"==(fixtypee[i].fieldFrontType))){
                str+=`<div class="layui-input-block">
                        <input type='text' name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-input search-field" autocomplete="off" fft="t_date" ffct="${fixtypee[i].fieldFrontConditionsType}">
                        <i class="dhicon dh-calendar icon_date_business" style="z-index:1"></i>
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                      </div>`
            }

            if (("t_year"==(fixtypee[i].fieldFrontType))){
                str+=`<div class="layui-input-block">
                        <input type='text' name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-input search-field" autocomplete="off" fft="t_year" ffct="${fixtypee[i].fieldFrontConditionsType}">
                        <i class="dhicon dh-calendar icon_date_business" style="z-index:1"></i>
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                      </div>`
            }

            if (("t_monthly"==(fixtypee[i].fieldFrontType))){
                str+=`<div class="layui-input-block">
                        <input type='text' name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-input search-field" autocomplete="off" fft="t_monthly" ffct="${fixtypee[i].fieldFrontConditionsType}">
                        <i class="dhicon dh-calendar icon_date_business" style="z-index:1"></i>
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                      </div>`
            }

            if (("t_datetime"==(fixtypee[i].fieldFrontType))){
                str+=`<div class="layui-input-block">
                        <input type='text' name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-input search-field" autocomplete="off" fft="t_datetime" ffct="${fixtypee[i].fieldFrontConditionsType}">
                        <i class="dhicon dh-calendar icon_date_business" style="z-index:1"></i>
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                      </div>`
            }

            if ("t_checkcondition"==(fixtypee[i].fieldFrontType)){
                var checkboxA = 'false';
                if (""!=(fixtypee[i].fieldFrontConditionsDefault)){
                    checkboxA = 'true';
                };
                str+=`<div class="layui-input-block">
                        <input type='checkbox' name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="search-field" lay-skin="primary" fft="t_checkcondition" attr="checked=${checkboxA}">
                      </div>`;
            }

            if ("t_radio"==(fixtypee[i].fieldFrontType)){
                str+=`<div class="layui-input-block">`
                switch (fixtypee[i].fields) {
                    case 'userSex' :
                        str+=`<div th:case="userSex">
                                <input type="radio" id="userSex" name="userSex" value="男" title="男" class="search-field" fft="t_radio">
                                <input type="radio" name="userSex" value="女" title="女">
                                <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                              </div>`
                        break;
                    case 'userSexDA' :
                        str+=`<div th:case="userSexDA">
                                <input type="radio" id="userSexDA" name="userSexDA" value="男" title="男" class="search-field" fft="t_radio">
                                <input type="radio" name="userSexDA" value="女" title="女">
                                <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                            </div>`;
                        break;
                    case '*' :
                        str+=`<div th:case="*">
                                <input type="radio" id="${fixtypee[i].fields}" name="${fixtypee[i].fields}" value="0" title="否" class="search-field" fft="t_radio">
                                <input type="radio" name="${fixtypee[i].fields}" value="1" title="是">
                                <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                            </div>`;
                        break;
                }
                str+=`</div>`;
            }

            if ("t_checkbox"==(fixtypee[i].fieldFrontType)){
                str+=`<div class="layui-input-block">
                        <input type="radio" id="${fixtypee[i].fields}" name="${fixtypee[i].fields}" value="0" title="否" class="search-field" fft="t_radio">
                        <input type="radio" name="${fixtypee[i].fields}" value="1" title="是">
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                    </div>`;
            }

            if (fixtypee[i].fieldFrontType.includes("t_buttontext")){
                str+=`<div class="layui-input-block">
                        <input type="text" name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-input search-field buttontext" getType="${fixtypee[i].fields}" autocomplete="off"/>
                        <i class="layui-icon layui-icon-more getMore" onclick="getMore('${fixtypee[i].fields}',null,'${fixtypee[i].fieldName}','${fixtypee[i].fieldSearchType}',true);" getType="${fixtypee[i].fields}"></i>
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                    </div>`;
            }

            if ("t_dropdown"==(fixtypee[i].fieldFrontType)){
                str+=`<div class="layui-input-block dropdown" fieldName="${fixtypee[i].fields}">
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                    </div>`;
            }

            if ("t_dropdownedit"==(fixtypee[i].fieldFrontType)){
                str+=`<div  class="layui-input-block dropdown" fieldName="${fixtypee[i].fields}">
                        <input type="text" name="${fixtypee[i].fields}" id="${fixtypee[i].fields}" class="layui-input" style="position:absolute;overflow:hidden;z-index:2;width: calc(100% - 30px);" lay-verify="required" onkeyup="inputSearch()" onblur="refreshSelect()" autocomplete="off">
                        <a class='dhicon dh-undo search-repeat' data-name="${fixtypee[i].fields}">&nbsp;</a>
                    </div>`;
            }
            str+=`</div>`
        }
    }
    str+=`<div class="layui-hide append-this"></div>`;
    return str;
};

function tablecols() {
    return [ [ //装箱标题栏
        {align: 'center', title: '商品信息', colspan: 6,width: 100}
        ,{align: 'center', title: '装箱情况', colspan: 11,width: 100}
    ], [
        {align: 'center',field: 'serial', title: '操作', width: 100}
        ,{field: 'commodityCode', title: '商品编码', width: 100}
        ,{field: 'nameGoodsCn', title: '商品名称', width: 250}
        ,{field: 'asin', title: 'ASIN', width: 100}
        ,{field: 'sku', title: 'SKU', width: 100}
        ,{field: 'fnsku', title: 'FNSKU', width: 100}
        ,{field: 'numPlanDeliver', title: '计划发货数量', width: 100}
        ,{field: 'theFirstCase', title: '第一箱', width: 100}
        ,{field: 'theSecondCase', title: '第二箱', width: 100}
        ,{field: 'theThirdCase', title: '第三箱', width: 100}
        ,{field: 'theFourCase', title: '第四箱', width: 100}
        ,{field: 'theFiveCase', title: '第五箱', width: 100}
        ,{field: 'theFixCase', title: '第六箱', width: 100}
        ,{field: 'theSevenCase', title: '第七箱', width: 100}
        ,{field: 'theEightCase', title: '第八箱', width: 100}
        ,{field: 'theNineCase', title: '第九箱', width: 100}
        ,{field: 'theTenCase', title: '第十箱', width: 100}
    ] ];
}

function tablecolsFh() {
    return [ [
        {align: 'center', field: 'serial', title: '操作', width: 100, fixed: 'left'}
        , {align: 'center', field: 'vDFilesDefault', title: '透明标附件', width: 100, fixed: 'left'}
        , {align: 'center', field: 'isSign', title: '透明标记', width: 100, fixed: 'left'}
        , {align: 'center', field: 'signCode', title: '透明标记编码', width: 100, fixed: 'left'}
        , {align: 'center', field: 'commodityCode', title: '商品编码', width: 100, fixed: 'left'}
        , {align: 'center', field: 'name', title: '商品名称', width: 250, fixed: 'left'}
              , {align: 'center', field: 'nameGoodsCn', title: '商品品名(中文)', width: 100}
              , {align: 'center', field: 'codeGoodsHs', title: '海关编码', width: 100}
              , {align: 'center', field: 'nameMaterialCn', title: '商品材质(中文)', width: 100}
              , {align: 'center', field: 'priceIn', title: '商品采购价（¥）', width: 100}
              , {align: 'center', field: 'linkJP', title: '竞品链接', width: 100}
              , {align: 'center', field: 'sku', title: 'SKU', width: 110}
              , {align: 'center', field: 'asin', title: 'ASIN', width: 110}
              , {align: 'center', field: 'fnsku', title: 'FNSKU', width: 110}
              , {align: 'center', field: 'numPlanDeliver', title: '计划发货数量', width: 100}
              , {align: 'center', field: 'numRealityDeliver', title: '实际发货数量', width: 100}
              , {align: 'center', field: 'numRealityDeliver1', title: '箱子1', width: 95}
              , {align: 'center', field: 'numRealityDeliver2', title: '箱子2', width: 95}
              , {align: 'center', field: 'numRealityDeliver3', title: '箱子3', width: 95}
              , {align: 'center', field: 'numRealityDeliver4', title: '箱子4', width: 95}
              , {align: 'center', field: 'numRealityDeliver5', title: '箱子5', width: 95}
              , {align: 'center', field: 'numRealityDeliver6', title: '箱子6', width: 95}
              , {align: 'center', field: 'numRealityDeliver7', title: '箱子7', width: 95}
              , {align: 'center', field: 'numRealityDeliver8', title: '箱子8', width: 95}
              , {align: 'center', field: 'numRealityDeliver9', title: '箱子9', width: 95}
              , {align: 'center', field: 'numRealityDeliver10', title: '箱子10', width: 95}
    ]];
}

    function tablecolsZD() {
        return [[
            {align: 'center', field: 'serial', title: '操作', width: 100, fixed: 'left'}
            , {align: 'center', field: 'vDFilesDefault', title: '透明标附件', width: 100, fixed: 'left'}
            , {align: 'center', field: 'isSign', title: '透明标记', width: 100, fixed: 'left'}
            , {align: 'center', field: 'signCode', title: '透明标记编码', width: 100, fixed: 'left'}
            , {align: 'center', field: 'commodityCode', title: '商品编码', width: 100, fixed: 'left'}
            , {align: 'center', field: 'name', title: '商品名称', width: 250, fixed: 'left'}
            , {align: 'center', field: 'nameGoodsCn', title: '商品品名(中文)', width: 100}
            , {align: 'center', field: 'codeGoodsHs', title: '海关编码', width: 100}
            , {align: 'center', field: 'nameMaterialCn', title: '商品材质(中文)', width: 100}
            , {align: 'center', field: 'priceIn', title: '商品采购价（¥）', width: 100}
            , {align: 'center', field: 'linkJP', title: '竞品链接', width: 100}
            , {align: 'center', field: 'vDFilesDefault', title: '是否有附件', width: 100, hide: true}
            , {align: 'center', field: 'spGuid', title: '商品id', width: 100, hide: true}
            , {align: 'center', field: 'sku', title: 'SKU', width: 110}
            , {align: 'center', field: 'asin', title: 'ASIN', width: 110}
            , {align: 'center', field: 'fnsku', title: 'FNSKU', width: 110}
            , {align: 'center', field: 'numPlanDeliver', title: '计划发货数量', width: 100}
            , {align: 'center', field: 'numRealityDeliver', title: '实际发货数量', width: 100}
        ]]
    }

function fbaRc() {
    return [ [
        {align: 'center', field: 'serial', title: '操作', width: 100, fixed: 'left'}
        , {align: 'center', field: 'vDFilesDefault', title: '透明标附件', width: 100, fixed: 'left'}
        , {align: 'center', field: 'isSign', title: '透明标记', width: 100, fixed: 'left'}
        , {align: 'center', field: 'signCode', title: '透明标记编码', width: 100, fixed: 'left'}
        , {align: 'center', field: 'commodityCode', title: '商品编码', width: 100, fixed: 'left'}
        , {align: 'center', field: 'name', title: '商品名称', width: 250, fixed: 'left'}
        , {align: 'center', field: 'sku', title: 'SKU', width: 110}
        , {align: 'center', field: 'asin', title: 'ASIN', width: 110}
        , {align: 'center', field: 'fnsku', title: 'FNSKU', width: 110}
        , {align: 'center', field: 'numPlanDeliver', title: '计划发货数量', width: 100}
        , {align: 'center', field: 'numRealityDeliver', title: '实际发货数量', width: 100}
        , {align: 'center', field: 'fbaWarehousingNum', title: 'FBA入仓数量', width: 100}
        , {align: 'center', field: 'numRealityDeliver1', title: '箱子1', width: 95}
        , {align: 'center', field: 'numRealityDeliver2', title: '箱子2', width: 95}
        , {align: 'center', field: 'numRealityDeliver3', title: '箱子3', width: 95}
        , {align: 'center', field: 'numRealityDeliver4', title: '箱子4', width: 95}
        , {align: 'center', field: 'numRealityDeliver5', title: '箱子5', width: 95}
        , {align: 'center', field: 'numRealityDeliver6', title: '箱子6', width: 95}
        , {align: 'center', field: 'numRealityDeliver7', title: '箱子7', width: 95}
        , {align: 'center', field: 'numRealityDeliver8', title: '箱子8', width: 95}
        , {align: 'center', field: 'numRealityDeliver9', title: '箱子9', width: 95}
        , {align: 'center', field: 'numRealityDeliver10', title: '箱子10', width: 95}
    ]];
}

function fbaRcZd() {
    return [[
        {align: 'center', field: 'serial', title: '操作', width: 100, fixed: 'left'}
        , {align: 'center', field: 'vDFilesDefault', title: '透明标附件', width: 100, fixed: 'left'}
        , {align: 'center', field: 'isSign', title: '透明标记', width: 100, fixed: 'left'}
        , {align: 'center', field: 'signCode', title: '透明标记编码', width: 100, fixed: 'left'}
        , {align: 'center', field: 'commodityCode', title: '商品编码', width: 100, fixed: 'left'}
        , {align: 'center', field: 'name', title: '商品名称', width: 250, fixed: 'left'}
        , {align: 'center', field: 'sku', title: 'SKU', width: 110}
        , {align: 'center', field: 'asin', title: 'ASIN', width: 110}
        , {align: 'center', field: 'fnsku', title: 'FNSKU', width: 110}
        , {align: 'center', field: 'numPlanDeliver', title: '计划发货数量', width: 100}
        , {align: 'center', field: 'numRealityDeliver', title: '实际发货数量', width: 100}
        , {align: 'center', field: 'fbaWarehousingNum', title: 'FBA入仓数量', width: 100}
    ]]
}